<?php

if ($_POST) {

	
try{  
	 $connect = new PDO('mysql:host=localhost;dbname=basketbal','cas','cas');
	 $connect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	 $query = "INSERT INTO video_other (embed_code, title, comment) VALUES (:embed_code, :title, :comment)";
	 $statement = $connect->prepare($query);
	 $sql_status = $statement->execute(
	  array(
	   ':title'  => $_POST["title"],
	   ':embed_code'  => $_POST["embed_code"],
	   ':comment'  => $_POST["comment"]
	  )
	 );
	 $output = '';
	 if ($sql_status) {
	 	  $output = '
	  <div class="alert alert-success">
	   Your data has been successfully saved into System
	  </div>
	  ';
	 } else {
	 	$output = "Something Wrong";
	 }

} catch (PDOException $e) {
    
    $output = $e->getMessage();
}

 echo $output;

}


?>